class Student:
    def __init__(self, name, age, tel):
        self.name = name
        self.age = age
        self.tel = tel
        print(f"名字为：{self.name}, 年龄为：{self.age}, 电话为：{self.tel}")

    # __lt__魔术方法
    def __lt__(self, other):
        return  self.age < other.age

    # __le__魔术方法
    def __le__(self, other):
        return  self.age < other.age

    # __eq__魔术方法
    def __eq__(self, other):
        return  self.age == other.age

    # __str__魔术方法
    def __str__(self):
        return f"名字为：{self.name}, 年龄为：{self.age}, 电话为：{self.tel}"

stu1 = Student("张三", 20, "18679772986")
stu2 = Student("李四", 30, "18679832729")
print(stu1 < stu2)
print(stu1 > stu2)
print(stu1 <= stu2)
print(stu1 >= stu2)
print(stu1 == stu2)

print(stu1)
print(stu2)
